home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Microsoft Plateform / Visual Basic 5.0 / Msvb50.ace / msvb50 / MSVB50 / VB / SAMPLES / VISDATA / ZOOM.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-10-16  |  3.6 KB  |  129 lines

  1. VERSION 5.00
  2. Begin VB.Form frmZoom 
  3.    ClientHeight    =   1800
  4.    ClientLeft      =   3600
  5.    ClientTop       =   3930
  6.    ClientWidth     =   4560
  7.    BeginProperty Font 
  8.       Name            =   "Tahoma"
  9.       Size            =   8.25
  10.       Charset         =   0
  11.       Weight          =   400
  12.       Underline       =   0   'False
  13.       Italic          =   0   'False
  14.       Strikethrough   =   0   'False
  15.    EndProperty
  16.    HelpContextID   =   2016148
  17.    Icon            =   "ZOOM.frx":0000
  18.    KeyPreview      =   -1  'True
  19.    LinkTopic       =   "Form1"
  20.    LockControls    =   -1  'True
  21.    ScaleHeight     =   1800
  22.    ScaleWidth      =   4560
  23.    ShowInTaskbar   =   0   'False
  24.    StartUpPosition =   1  'CenterOwner
  25.    Begin VB.CommandButton cmdClose 
  26.       Caption         =   "&Close"
  27.       Height          =   264
  28.       Left            =   120
  29.       MaskColor       =   &H00000000&
  30.       TabIndex        =   4
  31.       Top             =   36
  32.       Visible         =   0   'False
  33.       Width           =   972
  34.    End
  35.    Begin VB.TextBox txtZoomData 
  36.       Height          =   285
  37.       Left            =   40
  38.       TabIndex        =   0
  39.       Top             =   360
  40.       Width           =   4455
  41.    End
  42.    Begin VB.CommandButton cmdSave 
  43.       Caption         =   "&Save Changes"
  44.       Height          =   264
  45.       Left            =   120
  46.       MaskColor       =   &H00000000&
  47.       TabIndex        =   2
  48.       Top             =   36
  49.       Visible         =   0   'False
  50.       Width           =   1932
  51.    End
  52.    Begin VB.CommandButton cmdCloseNoSave 
  53.       Cancel          =   -1  'True
  54.       Caption         =   "&Close w/o Changes"
  55.       Height          =   264
  56.       Left            =   2160
  57.       MaskColor       =   &H00000000&
  58.       TabIndex        =   3
  59.       Top             =   40
  60.       Visible         =   0   'False
  61.       Width           =   1932
  62.    End
  63.    Begin VB.TextBox txtMemo 
  64.       BackColor       =   &H00FFFFFF&
  65.       Height          =   1332
  66.       Left            =   48
  67.       MultiLine       =   -1  'True
  68.       ScrollBars      =   2  'Vertical
  69.       TabIndex        =   1
  70.       Top             =   360
  71.       Visible         =   0   'False
  72.       Width           =   4452
  73.    End
  74. Attribute VB_Name = "frmZoom"
  75. Attribute VB_GlobalNameSpace = False
  76. Attribute VB_Creatable = False
  77. Attribute VB_TemplateDerived = False
  78. Attribute VB_PredeclaredId = True
  79. Attribute VB_Exposed = False
  80. Option Explicit
  81. '>>>>>>>>>>>>>>>>>>>>>>>>
  82. Const BUTTON1 = "&Close"
  83. Const BUTTON2 = "&Save Changes"
  84. Const BUTTON3 = "&Close w/o Changes"
  85. '>>>>>>>>>>>>>>>>>>>>>>>>
  86. Private Sub txtZoomData_KeyPress(KeyAscii As Integer)
  87.   'throw away the key if save not allowed
  88.   If cmdSave.Visible = False Then KeyAscii = 0
  89. End Sub
  90. Private Sub cmdCloseNoSave_Click()
  91.   gsZoomData = "__CANCELLED__"
  92.   Unload Me
  93. End Sub
  94. Private Sub cmdClose_Click()
  95.   Call cmdCloseNoSave_Click
  96.   Unload Me
  97. End Sub
  98. Private Sub Form_KeyPress(KeyAscii As Integer)
  99.   'check for the escape key
  100.   If KeyAscii = vbKeyEscape Then
  101.     Call cmdCloseNoSave_Click
  102.     Exit Sub
  103.   End If
  104. End Sub
  105. Private Sub Form_Load()
  106.   cmdClose.Caption = BUTTON1
  107.   cmdSave.Caption = BUTTON2
  108.   cmdCloseNoSave.Caption = BUTTON3
  109.   Me.Width = 4600
  110.   SendKeys "{End}"
  111. End Sub
  112. Private Sub Form_Resize()
  113.   On Error Resume Next
  114.   If txtZoomData.Visible Then
  115.     txtZoomData.Width = Me.Width - 200
  116.   Else
  117.     txtMemo.Width = Me.Width - 200
  118.     txtMemo.Height = Me.Height - 850
  119.   End If
  120. End Sub
  121. Private Sub cmdSave_Click()
  122.   If txtZoomData.Visible Then
  123.     gsZoomData = txtZoomData.Text
  124.   Else
  125.     gsZoomData = txtMemo.Text
  126.   End If
  127.   Unload Me
  128. End Sub
  129.